<template>
  <div>
    <el-button type="primary" @click="() => router.back()">返回</el-button>
    <h1 class="example">Example</h1>
    <p>示例页面.</p>
    <div>
      store示例
      <button @click="addCount">+</button>
      <button @click="minusCount">-</button>
      <p>{{ store.count }}</p>
    </div>
  </div>
</template>

<script setup lang="ts">
import { useMainStore } from '@/store'
import { useRouter } from 'vue-router'

const router = useRouter()

const store = useMainStore()

const addCount = () => {
  store.increment(1)
}

const minusCount = () => {
  store.increment(-1)
}

</script>

<style scoped lang="scss">

.example {
  color: red;
}

</style>